#pragma once
#include "InterestTable.h"
#include <string>

using namespace std;
/** \brief Handles all information for one person.
*
*/
class Person
{
private:
	string name;
	InterestTable<string> interests;

public:

	Person()
	{
	}

	Person(string name) { this->name = name; }

	Person(const Person &p)
	{
		this->name = p.name;
		this->interests.clear();
		this->interests = p.interests;
	}

	~Person()
	{
	}

	string GetName()
	{
		return name;
	}

	void AddInterest(string interest)
	{
		interests.add_at_head(interest);
	}

	InterestTable<string> GetInterests()
	{
		return interests;
	}

	bool CheckIfMatch(string interest)
	{
		if (interests.search(interest) != nullptr)
			return true;
		else
			return false;
	}

	friend bool operator== (const Person &lop, const Person &rop)
	{
		if (lop.name == rop.name)
		{
			return true;
		}
		else
			return false;
	}
};

